/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ejb;

import entities.ItemPurchased;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import javax.persistence.PersistenceContext;
import javax.persistence.PersistenceUnit;

/**
 *
 * @author Alejandro
 */
@Stateless
public class ItemPurchasedBean implements ItemPurchasedBeanLocal {
    
     @PersistenceContext(unitName="Retailshop-ejbPU")
   // @PersistenceUnit
    EntityManager manager;
    // Add business logic below. (Right-click in editor and choose
    // "Insert Code > Add Business Method")

    @Override
    public void addItemPurchased(ItemPurchased itemPurchased) {
      //manager.getTransaction().begin();
      manager.merge(itemPurchased);
     // manager.getTransaction().commit();
    }
}
